<?php

namespace App\Repository\Repositories;

use App\Repository\Repositories\Interfaces\RegionsRepository;
use App\Repository\Models\Regions;

/**
 * Class RegionsRepositoryEloquent.
 *
 * @package namespace App\Repository\Repositories;
 */
class RegionsRepositoryEloquent extends BaseRepository implements RegionsRepository
{
    /**
     * 搜索
     * @var array
     */
    protected $fieldSearchable = [
    ];

    /**
     * Specify Model class name
     *
     * @return string
     */
    public function model()
    {
        return Regions::class;
    }

    //查询父类ID所属地区列表
    public function getListAddress($parent_id)
    {
        $data = $this->query()->where('parent_id',$parent_id)->get();
        $data = $data ? $data->toArray(): '';

        return $data;
    }
}
